import uvicorn
from fastapi import FastAPI
from tortoise.contrib.starlette import register_tortoise

from apps.api.views.auth.user import user
from apps.api.views.console.home import home
from apps.api.views.web.website import website

import config

app = FastAPI(
    title='aiflow项目API文档',
    version='1.0.0'
)

register_tortoise(
    app,
    config=config.TORTOISE_ORM
)

app.include_router(user, prefix='/user', tags=['用户信息'])
app.include_router(home, prefix='/home', tags=['首页信息'])
app.include_router(website, prefix='/web', tags=['网站信息'])


if __name__ == '__main__':
    uvicorn.run("main:app", port=9090)
